package com.lb.jwitter.service;

import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import javax.jws.WebService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.lb.jwitter.*;
import com.lb.jwitter.hibernate.*;
import com.lb.jwitter.util.ConditionReport;

@Service("tbl_QLDTTXA_MonHocBatBuocService")
@Transactional
@WebService(endpointInterface = "com.lb.jwitter.service.Tbl_QLDTTXA_MonHocBatBuocService")
public class Tbl_QLDTTXA_MonHocBatBuocServiceImpl implements Tbl_QLDTTXA_MonHocBatBuocService,Serializable {

   private Log log = LogFactory.getLog(Tbl_QLDTTXA_MonHocBatBuocServiceImpl.class);
   private static final long serialVersionUID = -8740095022264495229L;

   @Autowired
   @Qualifier("tbl_QLDTTXA_MonHocBatBuocDAO")
   private Tbl_QLDTTXA_MonHocBatBuocDAO _tbl_QLDTTXA_MonHocBatBuocDao;

   @Autowired
   @Qualifier("tbl_QLDTTXA_MonHocDAO")
   private Tbl_QLDTTXA_MonHocDAO _tbl_QLDTTXA_MonHocDao;


   public final List<Tbl_QLDTTXA_MonHocBatBuoc> findAlltbl_QLDTTXA_MonHocBatBuoc(int pageSize, int page){
   List<Tbl_QLDTTXA_MonHocBatBuoc> result = get_tbl_QLDTTXA_MonHocBatBuocDao().findAll(pageSize, page);
       log.info("Number of user in DB:: "+result.size());
       return result;
   }

   @Transactional(noRollbackFor=IllegalArgumentException.class)
   public final Long createtbl_QLDTTXA_MonHocBatBuoc(Tbl_QLDTTXA_MonHocBatBuoc obj){
       return _tbl_QLDTTXA_MonHocBatBuocDao.save(obj);
   }

   public final void updatetbl_QLDTTXA_MonHocBatBuoc(Tbl_QLDTTXA_MonHocBatBuoc obj){
       _tbl_QLDTTXA_MonHocBatBuocDao.update(obj);
   }//end update methode

   public final Tbl_QLDTTXA_MonHocBatBuoc gettbl_QLDTTXA_MonHocBatBuoc (Long id){
       log.info("Try to retrieve the tbl_QLDTTXA_MonHocBatBuoc: "+id);
       return get_tbl_QLDTTXA_MonHocBatBuocDao().get(id);
   }

   public void deletetbl_QLDTTXA_MonHocBatBuoc(Long id){
       log.info("Try to delete the tbl_QLDTTXA_MonHocBatBuoc by Id : "+ id);
       if(_tbl_QLDTTXA_MonHocBatBuocDao.exists(id)){
	    _tbl_QLDTTXA_MonHocBatBuocDao.delete(id);
       } else {
       	throw new IllegalArgumentException("EmployeeId '"+id+"' does not exists");
       }
   }

   public void deleteListtbl_QLDTTXA_MonHocBatBuoc(String[] listId){
       for(String id : listId){
   	    deletetbl_QLDTTXA_MonHocBatBuoc(Long.parseLong(id));
       }
   }

   public List<Tbl_QLDTTXA_MonHocBatBuoc> findtbl_QLDTTXA_MonHocBatBuocByCondition(List<ConditionReport> cons,int pageSize,int page){ 
       return _tbl_QLDTTXA_MonHocBatBuocDao.findByCondition(Tbl_QLDTTXA_MonHocBatBuoc.class, cons, pageSize, page); 
   } 
 
   public int counttbl_QLDTTXA_MonHocBatBuocByCondition(List<ConditionReport> cons){ 
       return _tbl_QLDTTXA_MonHocBatBuocDao.countByCondition(Tbl_QLDTTXA_MonHocBatBuoc.class, cons); 
   } 
 
   public final Tbl_QLDTTXA_MonHocBatBuocDAO get_tbl_QLDTTXA_MonHocBatBuocDao() {
   	return _tbl_QLDTTXA_MonHocBatBuocDao;
   }
   public final void set_tbl_QLDTTXA_MonHocBatBuocDao(Tbl_QLDTTXA_MonHocBatBuocDAO obj) {
   	this._tbl_QLDTTXA_MonHocBatBuocDao = obj;
   }



   public Tbl_QLDTTXA_MonHocDAO get_tbl_QLDTTXA_MonHocDao() {
       return _tbl_QLDTTXA_MonHocDao;
   }
   public void set_tbl_QLDTTXA_MonHocDao(Tbl_QLDTTXA_MonHocDAO _tbl_QLDTTXA_MonHocDao) {
       this._tbl_QLDTTXA_MonHocDao = _tbl_QLDTTXA_MonHocDao;
   }

}//endclass

